var express = require('express')
var multer = require('multer');

var storage = multer.memoryStorage()
var upload =  multer({storage: storage})

// 创建当前级路由
var fileRouter = express.Router()

// 引入下一级路由
var itemCoverRouter = require('./itemCover')
var userPortraitRouter = require('./userPortrait')

// 路由到下一级
fileRouter.use('/itemCover', upload.single('file'), itemCoverRouter)
fileRouter.use('/userPortrait', upload.single('file'), userPortraitRouter)

// 暴露当前级路由
module.exports = fileRouter